import store from "@/store";
import request from "@/router/axios";

export function exportExcel(query) {
  return request({
    url: "/stm/swsttvmdailybill/export",
    method: "get",
    params: query,
    responseType: "arraybuffer"
  });
}

export function delBatch(id) {
  return request({
    url: "/stm/swsttvmdailybill/batchCascadeDel",
    method: "delete",
    data: id
  });
}

export function getTvmCode() {
  return request({
    url:
      "/support/swpmtvmcode/page?size=-1&status=1&stationCode=" +
      store.getters.userInfo.stationCode,
    method: "get"
  });
}

export function fetchList(query) {
  return request({
    url: "/stm/swsttvmdailybill/page",
    method: "get",
    params: query
  });
}

export function addObj(obj) {
  return request({
    url: "/stm/swsttvmdailybill",
    method: "post",
    data: obj
  });
}

export function getObj(id) {
  return request({
    url: "/stm/swsttvmdailybill/details/" + id,
    method: "get"
  });
}

export function delObj(id) {
  return request({
    url: "/stm/swsttvmdailybill/" + id,
    method: "delete"
  });
}

export function putObj(obj) {
  return request({
    url: "/stm/swsttvmdailybill",
    method: "put",
    data: obj
  });
}
export function saveObj(obj) {
  return request({
    url: "/stm/swsttvmdailybill/saveorupdate",
    method: "put",
    data: obj
  });
}

export function updateObj(obj) {
  return request({
    url: "/stm/swsttvmdailybill/update/pay",
    method: "put",
    data: obj
  });
}
